<?php
defined('IN_TS') or die('Access Denied.');
	$page = isset($page) ? intval($page) : 1;
		$lstart = $page*10-10;
	$sql = "select talkid,typeid,userid,title,count_comment,count_view,istop,isphoto,isattach,isposts,addtime,uptime from ".dbprefix."talk_topics where isshow='0' order by istop desc,uptime desc limit $lstart,10";
	
	$arrTopics = $db->fetch_all_assoc($sql);
	if( is_array($arrTopics)){
		foreach($arrTopics as $key=>$item){
			$arrTopics[$key]['user'] = aac('user')->getSimpleUser($item['userid']);
		}
	}
	
	$talk_num = $db->once_fetch_assoc("select count(talkid) from ".dbprefix."talk_topics where isshow='0'");
	
	$pageUrl = paginationv($talk_num['count(talkid)'], 10, $page, $url);
	
	//热门话题
	$arrTopic = $db->fetch_all_assoc("select talkid,title,count_comment from ".dbprefix."talk_topics order by count_comment desc limit 10");
	$title = "话题";
	include template("index");
